package com.ssm.exception;

/**
 * 自定义异常类
 */
public class SysException extends Exception{
    private int status;
    private String message;
    private ResultCode resultCode;

    /**
     * 供异常处理器使用
     * @param message
     */
    public SysException(String message) {
        this.message = message;
    }

    /**
     * 返回json数据时使用
     * @param resultCode
     */
    public SysException(ResultCode resultCode) {
        this.status = resultCode.getCode();
        this.message = resultCode.getMsg();
        this.resultCode = resultCode;
    }

    public ResultCode getResultCode() {
        return resultCode;
    }

    public void setResultCode(ResultCode resultCode) {
        this.resultCode = resultCode;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

}
